package com.fqgj.sentry.policy.client;

import com.fqgj.sentry.common.utils.ApiPage;
import com.fqgj.sentry.policy.domain.column.Column;
import com.fqgj.sentry.policy.domain.column.ColumnQueryInfo;
import com.fqgj.sentry.policy.entity.PcColumnEntity;
import com.fqgj.sentry.policy.entity.PcRuleColumnEntity;
import com.fqgj.sentry.policy.enums.ColumnTypeEnum;

import java.util.List;


/**
 * Created by zwh @yuntu-inc.com
 *
 * @description
 * @create 2017/7/29 0029 上午 11:46
 */
public interface ColumnService {
    /**
     * 新增字段
     *
     * @param pcColumnEntity
     * @return
     */
    PcColumnEntity saveColumn(PcColumnEntity pcColumnEntity);

    /**
     * 更新字段
     *
     * @param pcColumnEntity
     * @return
     */
    Boolean updateColumn(PcColumnEntity pcColumnEntity);


    /**
     * 更新字段
     *
     * @param column
     * @return
     */
    Integer updateColumn(Column column);

    /**
     * 删除字段
     *
     * @param columnId
     * @param columnId
     * @return
     */
    Integer deleteColumn(Long columnId);

    /**
     * 查询字段列表
     * 查询商户字段列表
     *
     * @return
     */
    List<PcColumnEntity> listColumn(Long merchantId, ColumnQueryInfo columnQueryInfo, ApiPage apiPage);

    /**
     * 根据id选择字段
     *
     * @param id
     * @return
     */
    PcColumnEntity selectColumn(Long id);

    /**
     * 根据商户ID  code 查询
     *
     * @return
     */
    PcColumnEntity selectByMerchantAndCode(Long merchantId, String code);


    /**
     * 规则字段   集合
     *
     * @param ruleId
     * @return
     */
    List<PcRuleColumnEntity> findRuleColumnByRuleId(Long ruleId);

    /**
     * 根据事件id 查询
     *
     * @return
     */
    List<PcColumnEntity> selectByMerchantIdAndEventId(Long merchantId,
                                                      List<Long> eventIds,
                                                      Integer columnType);

    /**
     * 根据id 查询
     * @param columnId
     * @return
     */
    PcColumnEntity findById(Long columnId);

}
